package com.ruoyi.web.wx.service.impl;

import java.util.List;

import com.ruoyi.web.wx.entity.Address;
import com.ruoyi.web.wx.mapper.AddressMapper;
import com.ruoyi.web.wx.service.IAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.core.text.Convert;

/**
 * 地址 服务层实现
 * 
 * @author ruoyi
 * @date 2019-08-27
 */
@Service("address")
public class AddressServiceImpl implements IAddressService
{
	@Autowired
	private AddressMapper addressMapper;

	/**
     * 查询地址信息
     * 
     * @param id 地址ID
     * @return 地址信息
     */
    @Override
	public Address selectAddressById(String id)
	{
	    return addressMapper.selectAddressById(id);
	}
	
	/**
     * 查询地址列表
     * 
     * @param address 地址信息
     * @return 地址集合
     */
	@Override
	public List<Address> selectAddressList(Address address)
	{
	    return addressMapper.selectAddressList(address);
	}
	
    /**
     * 新增地址
     * 
     * @param address 地址信息
     * @return 结果
     */
	@Override
	public int insertAddress(Address address)
	{
	    return addressMapper.insertAddress(address);
	}
	
	/**
     * 修改地址
     * 
     * @param address 地址信息
     * @return 结果
     */
	@Override
	public int updateAddress(Address address)
	{
	    return addressMapper.updateAddress(address);
	}

	/**
     * 删除地址对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteAddressByIds(String ids)
	{
		return addressMapper.deleteAddressByIds(Convert.toStrArray(ids));
	}

	@Override
	public List<Address> selectAllcommunity() {

		return addressMapper.selectAllcommunity();
	}

	@Override
	public List<Address> selectAllstreet() {
		return addressMapper.selectAllstreet();
	}

	@Override
	public List<Address> selectAllvillage() {

		return addressMapper.selectAllvillage();
	}

	@Override
	public List<Address> selectVillageBycommunity(String name) {
		return  addressMapper.selectVillageBycommunity(name);
	}

	@Override
	public List<Address> selectCommunityBystree(String name) {

			return  addressMapper.selectCommunityBystree(name);

	}

	@Override
	public List<Address> selectAllcity() {
		return  addressMapper.selectAllcity();
	}

	@Override
	public List<Address> selectDistrictByCity(String name) {
		return  addressMapper.selectDistrictByCity(name);
	}

	@Override
	public List<Address> selectStreetBDistrict(String name) {
		return  addressMapper.selectStreetBDistrict(name);
	}

	@Override
	public List<Address> selectcommunityByStreet(String name) {
		return  addressMapper.selectcommunityByStreet(name);
	}

	@Override
	public List<Address> selectvillageBycommunity(String name) {
		return  addressMapper.selectvillageBycommunity(name);
	}


}
